/*
 * @Author: your name
 * @Date: 2022-04-03 17:49:22
 * @LastEditTime: 2022-07-24 23:39:50
 * @LastEditors: YNT 2501512800@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \22-03-19 智慧社区\api\venue.js
 */
import wxRequest from '../utils/wx-request'

class SpecialModel extends wxRequest {
  // 场馆类型
  venueTypeList() {
    return this.request({
      url: `/api/v1/venv/type`,
      method: 'GET',
    })
  }

  //商户类型
  bussineesType() {
    return this.request({
      url: `/api/v1/shop/type`,
      method: 'GET',
    })
  }

  // 场馆列表
  venueList(venue_type, people_count, free, open, page_size) {
    return this.request({
      url: `/api/v1/venv/list?venv_type=${venue_type}&free=${free}&open=${open}&people_count=${people_count}&page_size=${page_size}`,
      method: 'GET',
    })
  }

  //商家列表
  bussinessList(id) {
    return this.request({
      url: `/api/v1/shop/list?shop_type_id=${id}`,
      method: 'GET',
    })
  }

  // 场馆详情
  venueDetail(id) {
    return this.request({
      url: `/api/v1/venv?id=${id}`,
      method: 'GET',
    })
  }

  // 商户详情
  bussinessDetail(id) {
    return this.request({
      url: `/api/v1/shop?id=${id}`,
      method: 'GET',
    })
  }

  // 新增商户拨打号码次数
  addPhoneNum(id) {
    return this.request({
      url: `/api/v1/shop/phones_num?id=${id}`,
      method: 'GET',
    })
  }

  // 场馆订单
  appointVenue(data) {
    return this.request({
      url: `/api/v1/venv_order`,
      method: 'POST',
      data,
    })
  }

  // 预约列表
  VenueList() {
    return this.request({
      url: `/api/v1/venv_order/list`,
      method: 'GET',
    })
  }

  // 获取二维码
  VenueEr(id) {
    return this.request(
      {
        url: `/api/venue/qr_code/${id}`,
        method: 'GET',
      },
      { responseType: 'arraybuffer' }
    )
  }
}

export default new SpecialModel()
